package team.sun.sss.dao.staff;

import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;
import team.sun.sss.pojo.staff.StaffCertificate;

import java.util.List;

@Mapper
@Repository
public interface StaffCertificateDao {
    @Select("select * from staff_certificate")
    List<StaffCertificate> getStaffCertificate();

    @Select("select * from staff_certificate where sta_num=#{staNum}")
    List<StaffCertificate> getStaffCertificateById(String staNum);

    @Delete("delete from staff_certificate where cert_id=#{certId}")
    int deleteStaffCertificate(int certId);

    @Insert("insert into staff_certificate(cert_name,cert_unit,cert_time,sta_num) values(#{certName},#{certUnit},#{certTime},#{staNum})")
    int addStaffCertificate(StaffCertificate staffCertificate);

    @Update("update staff_certificate set cert_name=#{certName},cert_unit=#{certUnit},cert_time=#{certTime},sta_num=#{staNum} where cert_id=#{certId}")
    int updateStaffCertificate(StaffCertificate staffCertificate);
}
